﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace RxjhServer
{
	public partial class SendGG : Form
	{
		public SendGG()
		{
			this.InitializeComponent();
		}

		private void button1_Click(object sender, EventArgs e)
		{
			if (this.textBox2.Text.Length < 2)
			{
				MessageBox.Show("发送内容不能为空");
				return;
			}
			try
			{
				int num = int.Parse(this.textBox1.Text);
				string text = this.textBox2.Text;
				foreach (Players current in World.allConnectedChars.Values)
				{
					if (current != null)
					{
						if (num == 0)
						{
							current.系统公告(text);
						}
						else if (num == 1)
						{
							current.系统滚动公告(text);
						}
						else
						{
							current.系统提示(text, num, "系统信息");
						}
					}
				}
				Form1.WriteLine(1, "发送公告：" + text);
			}
			catch (Exception ex)
			{
				Form1.WriteLine(1, "发送公告出错：" + ex.Message);
			}
		}
	}
}
